function Calculator2() {
    x = 0;
    y = 0;
    this.read = function() {
       this.x = Number(prompt("Input x:"));
       this.y = Number(prompt("Input y:"));
    }

    this.sum = function() {
        return this.x + this.y;
    }

    this.mul = function() {
        return this.x * this.y;
    }
};

let Calculator = new Calculator2();

Calculator.read();

alert("Sum = " + Calculator.sum());

alert("Mul = " + Calculator.mul());